package com.hctg.forced2sleep.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.actor.myandroidframework.utils.toaster.ToasterUtils;
import com.bumptech.glide.Glide;
import com.hctg.forced2sleep.R;
import com.hctg.forced2sleep.adapter.VipBuyActivityAdapter;
import com.hctg.forced2sleep.databinding.ActivityVipBuyBinding;

/**
 * description: 会员购买
 * company    :
 * @author    : ldf
 * date       : 2024/12/1 on 15:13
 */
public class VipBuyActivity extends BaseActivity<ActivityVipBuyBinding> {

    private VipBuyActivityAdapter mAdapter = new VipBuyActivityAdapter();

    public static void start(Context context) {
        context.startActivity(new Intent(context, VipBuyActivity.class));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //投诉建议
        viewBinding.tvPromote.setOnClickListener(v -> {
            //TODO: 弹框
            ToasterUtils.warning("投诉建议 还没做!");
        });
        //隐私
        viewBinding.llPrimary.setOnClickListener(v -> {
            v.setSelected(!v.isSelected());
        });
        //《用户协议》
        viewBinding.tvUserPolicy.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("《用户协议》 还没做!");
        });
        //《隐私协议》
        viewBinding.tvPrimaryPolicy.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("《隐私协议》 还没做!");
        });
        //邀请得会员
        viewBinding.tvInvite.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("邀请得会员 还没做!");
        });
        //立即开通
        viewBinding.tvBuy.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("立即开通 还没做!");
        });
        //使用优惠券
        viewBinding.btnCoupon.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("使用优惠券 还没做!");
        });
        //购买记录
        viewBinding.btnPayHistory.setOnClickListener(v -> {
            // TODO: 2024/12/1
            ToasterUtils.warning("购买记录 还没做!");
        });

        viewBinding.recyclerView.setAdapter(mAdapter);

        Glide.with(this)
                .load(R.drawable.default_avatar)
                .circleCrop()
                .into(viewBinding.ivAvatar);
        viewBinding.tvName.setText("游客昵称");
        viewBinding.ivVip.setVisibility(View.VISIBLE);

        mAdapter.addData("");
        mAdapter.addData("");
        mAdapter.addData("");
    }
}